package stark.app.function.g2048;

import android.widget.TextView;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.stark.game2048.lib.bean.G2048OpenInfo;

import org.jetbrains.annotations.NotNull;

import stark.app.R;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;

/**
 * Author：daizhongbin on 2023/1/4
 * Email：1027154338@qq.com
 * Desc:
 */
public class OpenModeAdapter extends StkProviderMultiAdapter<G2048OpenInfo> {

    public OpenModeAdapter() {
        super(1);
        addItemProvider(new ItemProvider());
    }

    private class ItemProvider extends BaseItemProvider<G2048OpenInfo> {

        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_open_mode_sel;
        }

        @Override
        public void convert(@NotNull BaseViewHolder holder, G2048OpenInfo g2048OpenInfo) {
            TextView tvName = holder.getView(R.id.tvName);
            tvName.setText(g2048OpenInfo.openNum + "开局");
        }
    }

}
